﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BOMSWinService.DATA
{
    public class ProtocolPack
    {
        /// <summary>
        /// 包头部
        /// </summary>
        public string PackHead { get; set; }
        /// <summary>
        /// 包尾部
        /// </summary>
        public string PackTail { get; set; }
        /// <summary>
        /// 数据段的字节长度
        /// </summary>
        public int DataLenth { get; set; }
        /// <summary>
        /// 当前时间
        /// </summary>
        public DateTime Dtm { get; set; }
        /// <summary>
        /// 电池组数
        /// </summary>
        public int GroupCount { get; set; }
        /// <summary>
        /// 数组（各组电池个数）
        /// </summary>
        public int[] Arr_BatCount;

        /// <summary>
        /// 额定容量
        /// </summary>
        public double RatedCapacity { get; set; }
        /// <summary>
        /// 环境温度
        /// </summary>
        public double EnvTemp { get; set; }
        /// <summary>
        /// 电池组列表
        /// </summary>
        public List<ProtocolGroup> GroupList;
    }
    public class ProtocolGroup
    {
        /// <summary>
        /// 组名称
        /// </summary>
        public string GroupNmae { get; set; }
        /// <summary>
        /// 组-电压
        /// </summary>
        public double GroupV { get; set; }
        /// <summary>
        /// 组-电流
        /// </summary>
        public double GroupI { get; set; }
        /// <summary>
        /// 组-状态值
        /// </summary>
        public int GroupStatus { get; set; }
        /// <summary>
        /// 组-状态描述
        /// </summary>
        public string GroupStatusDescr { get; set; }
        /// <summary>
        /// 组-故障
        /// </summary>
        public int GroupError { get; set; }
        /// <summary>
        /// 组-故障描述
        /// </summary>
        public string GroupErrorDescr { get; set; }
        /// <summary>
        /// 充放计时(hh：mm)
        /// </summary>
        public string InOutTimeLong { get; set; }
        /// <summary>
        /// 充放容量(0.01Ah)
        /// </summary>
        public double InOutCapacity { get; set; }
        /// <summary>
        /// 剩余容量
        /// </summary>
        public double RemainingCapacity { get; set; }
        /// <summary>
        /// 剩余可用时
        /// </summary>
        public string RemainingUseTime { get; set; }

        /// <summary>
        /// 电压边界
        /// </summary>
        public Boundary VBoundary;

        /// <summary>
        /// 温度边界
        /// </summary>
        public Boundary TBoundary;

        /// <summary>
        /// 内阻边界
        /// </summary>
        public Boundary RBoundary;

        /// <summary>
        /// 单体电池列表
        /// </summary>
        public List<ProtocolBattay> BattList;


    }
    public class ProtocolBattay
    {
        /// <summary>
        /// 电池标号
        /// </summary>
        public int BattayID { get; set; }
        /// <summary>
        /// 电池状态
        /// </summary>
        public int BattayStatus { get; set; }
        /// <summary>
        /// 电池状态描述
        /// </summary>
        public string BattayStatusDescr { get; set; }
        /// <summary>
        /// 电压
        /// </summary>
        public double BattayV { get; set; }
        /// <summary>
        /// 温度
        /// </summary>
        public double BattayT { get; set; }
        /// <summary>
        /// 内阻
        /// </summary>
        public double BattayR { get; set; }
        /// <summary>
        /// 剩余容量
        /// </summary>
        public double BattayRemainingCapacity { get; set; }
    }
    public struct Boundary
    {
        /// <summary>
        /// 最大值
        /// </summary>
        public double MaxV ;
        /// <summary>
        /// （最大值）电池的编号
        /// </summary>
        public string MaxNO ;
        /// <summary>
        /// 最小值
        /// </summary>
        public double MinV ;
        /// <summary>
        /// （最小值）电池的编号
        /// </summary>
        public string MinNO;
    }

}
